home *** CD-ROM | disk | FTP | other *** search
/ Windows 6-Pak - Disc 5 / Windows 6-Pak (InfoMagic) (Disc 5) (1999).ISO / C&C++Tools / sbparser.exe / dll / inc / astsbpar.h < prev   
Encoding:
C/C++ Source or Header  |  1998-10-11  |  6.4 KB  |  184 lines

  1. #if !defined(__astdsbpar_h)
  2. #define __astdsbpar_h
  3.  
  4. /*  Projekt csbparse
  5.     softbase
  6.      Copyright ⌐ 1993-1998 by SoftBase
  7.  
  8.      SUBSYSTEM:     csbparse.dll 3.7
  9.      FILENAME:       astdsbpar.h
  10.  
  11.      ABSTRACT
  12.      ========
  13.     Functions for creation and use of sbParser and sbCalculator objects by
  14.     HANDLE (void*) with any C/C++ compiler.
  15. */
  16.  
  17. //+++Remember to include the astsbpar.cpp into your project+++ 
  18.  
  19. #if defined(__BORLANDC__)
  20. #else
  21. #endif
  22.  
  23. #include <windows.h>
  24.  
  25. //------ DLL functions ---------------------------------------------------------
  26.  
  27. bool InitSTDsbParserDLL(char* iv = NULL);
  28. void InitMessageOut();
  29. int GetInitCount();
  30. bool IsRegSTDsbParser();
  31. bool DeinitSTDsbParserDLL();
  32.  
  33. //------ sbParser functions ----------------------------------------------------
  34.  
  35. char* GetParserVersionString(char *strbuffer);
  36. char* GetParserVersionNumber(char *strbuffer);
  37.  
  38. //iux == reserved for internal use
  39. HANDLE CreateNewParser(char *FunctionIn, int VarCountIn,
  40.       char *VarDescIn,
  41.       bool iu1 = true, bool iu2 = true, bool iu3 = true, bool iu4 = true);
  42. HANDLE CreateNewParser(char *FunctionIn, int BaseIn = 10,
  43.       bool iu1 = true, bool iu2 = true, bool iu3 = true, bool iu4 = true);
  44. HANDLE CreateNewParser(char *FunctionIn, int BaseIn,
  45.         int VarCountIn, char *VarDescIn,
  46.       bool iu1 = true, bool iu2 = true, bool iu3 = true, bool iu4 = true);
  47.  
  48. bool DeleteParser(HANDLE hParser);
  49.  
  50. bool SetVarCont(HANDLE hParser, const char *AVarDescIn,
  51.         long double VarContIn);
  52.  
  53. long double GetResult(HANDLE hParser);
  54. long double GetResult(HANDLE hParser, long double VarContIn);
  55. long double GetResultExt(HANDLE hParser, long double VarContIn[]);
  56.  
  57. bool IsParserFunction(const char *FuncStrIn);
  58.  
  59. //use these functions if your compiler doesn't support long double (80bit)
  60. bool dSetVarCont(HANDLE hParser, const char *AVarDescIn,
  61.         double VarContIn);
  62.  
  63. double dGetResult(HANDLE hParser);
  64. double dGetResult(HANDLE hParser, double VarContIn);
  65. double dGetResultExt(HANDLE hParser, double VarContIn[]);
  66. //+++
  67.  
  68. const char*    GetOriginFunc(HANDLE hParser, char *strbuffer);
  69. long    GetOriginFuncLen(HANDLE hParser);
  70. int GetOriginVarCount(HANDLE hParser);
  71. bool GetIsOriginFunc(HANDLE hParser, char *FunctionIn);
  72.  
  73. bool GetIsError(HANDLE hParser);
  74. int GetGlobalError(HANDLE hParser);
  75. char* GetUnknownFunction(HANDLE hParser, char *strbuffer);
  76.  
  77. bool SetBaseTo(HANDLE hParser, int BaseIn);
  78. bool SetAngularUnitTo(HANDLE hParser, int AngularUnitIn);
  79. bool SetNewFunction(HANDLE hParser, char *FunctionIn);
  80.  
  81. int GetBase(HANDLE hParser);
  82. int GetAngularUnit(HANDLE hParser);
  83.  
  84. //------ useful functions -----------------------------------------------------
  85.  
  86. bool ConvertToBase(char *strbuffer, const long double value,
  87.                                 int b_point, int BaseIn);
  88. long double ConvertBaseTold(const char *strValue, int BaseIn,
  89.                                 char **endptr = NULL);
  90. long double ConvertBaseTold(const char *strValue, int BaseIn,
  91.                         int* errPos);
  92.  
  93. unsigned int SetFPError(bool Enable = false);
  94.  
  95. char* ldtochar(char *strbuffer, const long double value,
  96.                                 int point = 0, bool Validate = true);
  97. long double chartold(const char *strValue, char **endptr = NULL,
  98.                                 bool Validate = true);
  99. long double chartold(const char *strValue, int* errPos,
  100.                                 bool Validate = true);
  101.  
  102. long double corrroundl(long double value);
  103. long double corrroundl(long double value,int point);
  104.  
  105. char* turnintochar(char *strbuffer, const char *SubFuncIn, const char *searchIn,
  106.                                 const char *turnIn, bool singleVar = false);
  107. char* GetLastValue(char* strbuffer, const char* SearchString,
  108.                                   int CurrPos, int *StartPos, bool withOper = false);
  109.  
  110. //use these functions if your compiler doesn't support long double (80bit)
  111. bool dConvertToBase(char *strbuffer, const double value,
  112.                                 int b_point, int BaseIn);
  113. double ConvertBaseTod(const char *strValue, int BaseIn,
  114.                                 char **endptr = NULL);
  115. double ConvertBaseTod(const char *strValue, int BaseIn,
  116.                         int* errPos);
  117.  
  118. char* dtochar(char *strbuffer, const double value,
  119.                                 int point = 0, bool Validate = true);
  120. double chartod(const char *strValue, char **endptr = NULL,
  121.                                 bool Validate = true);
  122. double chartod(const char *strValue, int* errPos,
  123.                                 bool Validate = true);
  124.  
  125. double corrround(double value,int point);
  126. //+++
  127.  
  128. //------ Debug and Information -------------------------------------------------
  129.  
  130. bool GetDebugsbDLL();
  131. bool SetDebugsbDLL(bool debugIn);
  132.  
  133. bool GetVarStruct(HANDLE hParser, HANDLE VarStructIn);
  134. bool GetOpStructPos(HANDLE hParser, int pos, char *buffFunction,
  135.                                   int* val1, int* val2, int* valResult);
  136. bool GetInvValuesPos(HANDLE hParser, int pos, long double *val);
  137.  
  138. //use these functions if your compiler doesn't support long double (80bit)
  139. bool dGetVarStruct(HANDLE hParser, HANDLE VarStructIn);
  140. bool dGetInvValuesPos(HANDLE hParser, int pos, double *val);
  141. //+++
  142.  
  143. //------ sbCalculator functions ------------------------------------------------
  144.  
  145. HANDLE CreateNewCalculator(char *InitStr, bool fastIn = true,
  146.                                 int VarCountIn = 0, char* VarDescIn = "");
  147.  
  148. bool DeleteCalculator(HANDLE hCalculator);
  149.  
  150. int GetVarCount(HANDLE hCalculator);
  151. char *GetFunction(HANDLE hCalculator, char *strbuffer);
  152.  
  153. //iux == reserved for internal use
  154. bool Make(HANDLE hCalculator, char *Input, bool iu1 = false);
  155.  
  156. char *GetShowFunc(HANDLE hCalculator, char *strbuffer,int point = 0,
  157.                                  long double VarContIn[] = 0, bool ext = false,
  158.                         char* secondShow = 0);
  159. long double GetLastResult(HANDLE hCalculator);
  160.  
  161. //use these functions if your compiler doesn't support long double (80bit)
  162. char *dGetShowFunc(HANDLE hCalculator, char *strbuffer,int point = 0,
  163.                                  double VarContIn[] = 0, bool ext = false,
  164.                         char* secondShow = 0);
  165. double dGetLastResult(HANDLE hCalculator);
  166. //+++
  167.  
  168. char *GetInfo(HANDLE hCalculator, char *strbuffer);
  169.  
  170. void SetFast(HANDLE hCalculator, bool fastIn = true);
  171. bool GetFast(HANDLE hCalculator);
  172.  
  173. void SetFatalErr(HANDLE hCalculator, bool FatalErrIn=true);
  174. bool GetFatalErr(HANDLE hCalculator);
  175.  
  176. bool SetAngularUnitInOutTo(HANDLE hCalculator, int AngularUnitIn);
  177. int GetAngularUnitInOut(HANDLE hCalculator);
  178. bool SetBaseInTo(HANDLE hCalculator, int BaseIn);
  179. int GetBaseIn(HANDLE hCalculator);
  180. bool SetBaseOutTo(HANDLE hCalculator, int BaseIn);
  181. int GetBaseOut(HANDLE hCalculator);
  182.  
  183. #endif                                   // __astdsbpar_h
  184.